import http from '../common/http/http.js'
// 商品发布
export const publish = (data) => {
	return http.post('/api/goods/publish', data)
}

// 根据分类获取商品
export const getGoodsByCategoryApi = (data) => {
	return http.get('/api/goods/getGoodsByCategory', data)
}

//    我的发布页面生成上架瀑布流
export const getMyListApi = (data) => {
	return http.get('/api/goods/getMyList', data)
}

//    我的发布页面生成上架瀑布流
export const getMyPublishedListApi = (data) => {
	return http.get('/api/goods/getMyPublishedList', data)
}


//    我的发布页面生成下架瀑布流
export const getMySalesListApi = (data) => {
	return http.get('/api/goods/getMySalesList', data)
}


// 商品编辑
export const editApi = (data) => {
	return http.put('/api/goods/edit', data)
}

// 上架
export const onShelfApi = (goodsId) => {
	return http.post(`/api/goods/onShelf/${goodsId}`)
}

// 下架
export const offShelfApi = (goodsId) => {
	return http.post(`/api/goods/offShelf/${goodsId}`)
}


// 删除商品
export const deleteGoodsApi = (goodsId) => {
	return http.del(`/api/goods/${goodsId}`)
}